<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/themes/bootstrap/easyui.css" />
<link type="text/css"
	href="${pageContext.request.contextPath}/themes/icon.css"
	rel="stylesheet">
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery-1.9.1.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/easyui-lang-zh_CN.js"></script>
<title>Insert title here</title>
</head>
<script type="text/javascript">
$(function(){
	
	$('#dg').datagrid({    
	    url:'ShowEIR_showEIR', 
	    rownumbers:true,
	    pagination:true,
	    pageSize:10,
	    pageList:[10,15,20],
	    columns:[[
	        {field:'checkbox',title:'ck',width:100,checkbox:true},
	        {field:'reid',title:'交接单编号',width:100,hidden:true},
	        {field:'seid',title:'封装袋号',width:100},
	        {field:'oid',title:'封单号/订单编号',width:100},
	        {field:'goodsname',title:'订单货物',width:100},
	        {field:'crid',title:'车辆编号',width:100},
	        {field:'did',title:'车辆司机',width:100},
	        {field:'restartp',title:'起点站',width:100},    
	        {field:'reendp',title:'终点站',width:100,align:'right'},
	        {field:'redate',title:'日期',width:100},
	        
	       
	        {field:'uid',title:'接收人',width:100},
	        
	    ]],
	    toolbar: [{
			iconCls: 'icon-add',
			text:'录入出货信息',
			handler: function(){
				$('#win').window('open');
				$('#tb2').textbox('clear');
				$('#tb4').textbox('clear');
				$('#tb5').textbox('clear');
			}
		},'-',{
			iconCls: 'icon-help',
			handler: function(){alert('帮助按钮')}
		}]

	});
	
	$('#cc').combobox({    
	    url:'OrderNo_orderNo',    
	    valueField:'id',    
	    textField:'text'   
	});
	 $('#btn2').bind('click', function(){    
		 $('#win').window('close');     
	    });
	
	$("input",$("#tb2").next("span")).blur(function(){  
		var oid=$('#tb2').textbox('getValue');
		$.ajax({
			url:'Onblur_onblur',
			type:'post',
			data:{'oid':oid},
			dataType:'json',
			success:function(data){
				if(data==1){
					//var goodsname="${sessionScope.goodsname}";
					
					//alert(goodsname);
					//alert(goodsnamed);
					//$('#tb3').textbox('setValue',goodsname);
					//$('#tb4').textbox('setValue',56);
					//$('#tb5').textbox('setValue',23);
				}else{
					
					$.messager.alert('我的消息','该订单号有误，请重新输入！','info');
					$('#tb2').textbox('clear');
				}
			}
		})
})

$('#cc').combobox({    
    url:'CarID_carID',    
    valueField:'id',    
    textField:'text'   
});
	
	$('#cc1').combobox({    
	    url:'CarUname_carUname',    
	    valueField:'id',    
	    textField:'text'   
	});
	
	 $('#btn1').bind('click', function(){    
		var seid=$('#tb1').textbox('getValue');
		var oid=$('#tb2').textbox('getValue');
		var crid=$('#cc').combo('getValue');
		var did=$('#cc1').combo('getValue');
		$.ajax({
			url:'InsertEIR_insertEIR',
			type:'post',
			data:{'seid':seid,'oid':oid,'crid':crid,'did':did},
			dataType:'json',
			success:function(data){
				if(data==1){
					$.messager.show({
						title:'我的消息',
						msg:'保存成功',
						timeout:2000,
						showType:'slide'
					});

				}
			}
		})
	    });
	
	
})
</script>
<body>
<table id="dg"></table>

<div id="win" class="easyui-window" title="" style="width:600px;height:400px"   
        data-options="iconCls:'icon-save',modal:true,closed:true">
        <div style="margin-top: 90px;margin-left: 170px">
    封装袋号<input id="tb1" class="easyui-textbox" type="text" style="width:200px"><br><br>
    封 &nbsp;单&nbsp;号<input id="tb2" class="easyui-textbox" type="text" style="width:200px"><br><br>
   <!--  货物清单<input id="tb3" class="easyui-textbox" type="text" style="width:200px" value="${sessionScope.goodsname}"><br><br>
    收&nbsp;寄&nbsp;地<input id="tb4" class="easyui-textbox" type="text" style="width:200px"><br><br>
    交&nbsp;接&nbsp;地<input id="tb5" class="easyui-textbox" type="text" style="width:200px"><br><br> -->
    运输车号<input id="cc" name="dept" class="easyui-combobox" style="width:200px"> <br><br>
    承&nbsp;运&nbsp;人<input id="cc1" name="dept" class="easyui-combobox" style="width:200px"> <br><br>
    <!--  接&nbsp;收&nbsp;人   <input id="tb6" class="easyui-textbox" type="text" style="width:200px"><br><br>-->  </div>
    <div style="margin-top: 30px;margin-left: 250px">
    <a id="btn1" href="#" class="easyui-linkbutton">保存</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <a id="btn2" href="#" class="easyui-linkbutton">取消</a></div>
        </div> 
</body>
</html>